package com.bluesky.common.exception.advice;

import com.bluesky.common.exception.BizException;
import com.bluesky.common.response.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.net.BindException;

@RestControllerAdvice
public class CommonExceptionHandler {
    @ExceptionHandler(BizException.class)
    public Result handleBizException(BizException e){
        //TODO 记录日志
        System.out.println("记录exception");
        return Result.Result(e.getErrorCode(),e.getMessage(),null);
    }
}
